import "./App.css";
import React from "react";

class App extends React.Component {
  constructor() {
    super();
    this.dom_ref = React.createRef();
    console.log("constructor", this.dom_ref);
  }
  componentDidMount() {
    // 一样的
    console.log("componentDidMount", this.dom_ref);
    let div = document.querySelector(".App");
    console.log("div", { div });
  }
  render() {
    return (
      <div className="App" ref={this.dom_ref}>
        Hello World
      </div>
    );
  }
}
export default App;
